package com.springBoot.springBootSysCore.modules.controller.api.system;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.springBoot.springBootSysCore.common.persistence.DataTables;
import com.springBoot.springBootSysCore.common.utils.FileUtil;
import com.springBoot.springBootSysCore.common.utils.returnUtil.AjaxJson;
import com.springBoot.springBootSysCore.common.utils.returnUtil.PageUtils;
import com.springBoot.springBootSysCore.modules.controller.web.base.BaseController;
import com.springBoot.springBootSysCore.modules.entity.system.SysIntro;
import com.springBoot.springBootSysCore.modules.enums.base.DeleteStateEnum;
import com.springBoot.springBootSysCore.modules.services.system.SysIntroService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;

/**
 *app引导图
 */
@RestController
@RequestMapping("${apiPath}/auth/sysIntro")
public class SysIntroControllerApi extends BaseController<SysIntro,String> {
    @Autowired
    private SysIntroService sysIntroService;

    @RequestMapping(value="queryByPage",method= RequestMethod.POST)
    public Object queryByPage(HttpServletRequest request,
                              @RequestParam(required = false ,defaultValue = "1")int pageNumber,
                              @RequestParam(required = false ,defaultValue = "3")int pageSize,
                              SysIntro entity,
                              Model model) throws JsonProcessingException{
        return sysIntroService.queryByPage(PageUtils.buildPageRequest(pageNumber, pageSize, "sort", "desc"),entity);
    }
}
